let timer = null

export function throttle(fn, delay, trailing) {
    if (timer) {
        trailing?.call(this)
    } else {
        timer = setTimeout(() => {
            timer = null
        }, delay)
        fn.call(this)
    }
}
